package lab01;

import java.util.Scanner;

public class Test05 {


    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in );
        int n=sc.nextInt();
        int sum1=0;
        int sum2=0;
        int sum3=0;
        //for
        for(int i=1;i<=n;i++){
            sum1+=i;
        }
        System.out.println(sum1);

        //while
        int a=0;
        while( a<n){
            sum2+=a;
        }
        //do
        int b=0;
        do {
            b++;
            sum3+=b;
        }while (b<n);

        System.out.println(sum1);
        System.out.println(sum2);
        System.out.println(sum3);
    }


}